/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package digitaldreamers.games.ddmonsters.servers.gameserver.network.packets.receiving;

import digitaldreamers.libraries.games.servers.networkmanagement.abstracts.IConnectionHandler;
import digitaldreamers.libraries.games.servers.networkmanagement.packets.receiving.AbReceivablePacket;
import digitaldreamers.games.ddmonsters.servers.gameserver.components.PlayerComponent;
import java.io.DataInputStream;
import java.io.IOException;

/**
 *
 * @author DaoLe
 */
public class RLoginByLoginAndPasswordRequest extends AbReceivablePacket {
    private String mLogin;
    private String mPassword;
    
    public RLoginByLoginAndPasswordRequest(IConnectionHandler pConnectionHandler){
        super(pConnectionHandler);
    }

    @Override
    public void execute() throws Exception {
        PlayerComponent player = (PlayerComponent)mConnectionHandler.getPlayer();
        player.loginByLoginAndPassword(mLogin, mPassword);
    }
    
    @Override
    protected void readData(DataInputStream pDIS) throws IOException {
        mPacketId = pDIS.readInt();
        mLogin = pDIS.readUTF();
        mPassword = pDIS.readUTF();
    }
}
